package com.khyr.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.khyr.entity.RegFee;
import com.khyr.service.RegFeeService;
import com.khyr.vo.R;
import com.khyr.vo.RegFeeVo;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 宋一恒
 * @version 1.0
 */
@RestController
@RequestMapping("/systemManager/regFee")
public class RegFeeController {
    @Autowired
    private RegFeeService regFeeService;
    //查询所有
    @PostMapping("/findRegisteredItemByCond")
    public R<Page<RegFee>> findRegisteredItemByCond(@RequestBody RegFeeVo regFeeVo) {
        return regFeeService.findRegisteredItemByCond(regFeeVo);
    }
    //添加
    @PostMapping("/addRegFee")
    public R<String> addRegFee(@RequestBody RegFee regFee) {
        return regFeeService.addRegFee(regFee);
    }

    //修改
    @PostMapping("/updateRegFee")
    public R<String> updateRegFee(@RequestBody RegFee regFee) {
        return regFeeService.updateRegFee(regFee);
    }

    //删除一个
    @DeleteMapping("/getRegisteredItemByRegisteredItemId/{id}")
    public R<String> getRegisteredItemByRegisteredItemId(@PathVariable Long id) {
        return regFeeService.deleteRegFeeById(id);
    }

    //批量删除
    @DeleteMapping("/deleteRegFeeByIds/{ids}")
    public R<String> deleteRegFeeByIds(@PathVariable List<Long> ids) {
        return regFeeService.deleteRegFeeByIds(ids);
    }
}
